# There are several functions that were written for single input while most R default functions could be ran with vector input
# this function is an enhancement for this situation

temp_func <- function(){
  return(0)
}

vec_inject_function <- function(func = temp_func, vec = c()){
  result <- c()
  if(length(vec) < 1){
    return(result)
  }else{
    for(i in 1:length(vec)){
      result <- c(result, func(vec[i]))
    }
    return(result)
  }
  
}


#### TEST AREA ####
# library(devtools)
# source_url("https://gitee.com/ry2an/my_public_functions_r/raw/master/date_trans.R")
# 
# # could get error
# # date_trans(c("48372", "49925"))
# 
# vec_inject_function(func = date_trans, vec = c("48372", "49925"))
